# https://www.cnblogs.com/alex-13/p/12016554.html
from selenium import webdriver
import time

# 声明浏览器
browser = webdriver.Chrome()

# 找到html文件并打开
Path_name = 'D:/PythonWorkspace/python100/Day48/selenium.html'
browser.get(Path_name)

# 查找元素并操作
User_name = browser.find_element_by_css_selector('[name="username"]').send_keys('rabbit')
time.sleep(2)
Pass_word = browser.find_element_by_css_selector('[name="password"]').send_keys('love')
time.sleep(2)
Confirm_button = browser.find_element_by_css_selector('#sub').click()
time.sleep(3)

# 输入用户名密码确认
# User_name.send_keys('rabbit')
# time.sleep(2)
# Pass_word.send_keys('love')
# time.sleep(2)
# Confirm_button.click()
# time.sleep(3)

# 关闭浏览器
browser.quit()

